package com.pingan.haofang.searchcloud.index.dao;

import java.util.List;
import java.util.Set;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.stereotype.Repository;

import com.pingan.haofang.searchcloud.index.domain.Index;

/**
 * 索引基本信息DAO
 *
 * @author baojie371
 * @date 17/5/3
 * @since 1.0.0
 */
@Repository
public interface IndexDao extends JpaRepository<Index, Long>, JpaSpecificationExecutor<Index> {

    Page<Index> findByProjectIdAndStatus(long projectId, int status, Pageable page);

    List<Index> findByProjectIdAndStatus(long projectId, int status);
    
    List<Index> findByProjectIdAndIndexName(long projectId, String indexName);

    List<Index> findByIndexName(String indexName);

    List<Index> findByIndexNameAndStatus(String indexName, int status);

    List<Index> findByStatus(int status);

    List<Index> findByIndexNameIn(Set<String> strings);
    
    List<Index> findByIdInAndStatus(List<Long> indexIds, int value);
}
